﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AdventureWorks.Data.Common
{
    public interface IRepository<TEntity>
        where TEntity : class 
    {
        TEntity Get(int id);
        TEntity FindByUniqueKey(Func<TEntity, bool> predicate);
        TEntity Exists(Func<TEntity, bool> predicate);
        List<TEntity> Find(Func<TEntity, bool> predicate);
        List<TEntity> FindAll();

        int Add(TEntity entity);
        void AddRange(List<TEntity> entities);
        void Update(TEntity entity);
        void Delete(int id);
        void DeleteAll();
    }
}
